package com.deke.order.controller;

import com.deke.order.service.QianCourseCollectService;
import com.deke.order.vo.ShouCangCourseVo;
import com.deke.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：Username 刘亦辰（59372312@qq.com）
 * @date ：Created in 2022/12/30 15:13
 * @description：
 * @modified By：
 * @version:
 **/
@RestController
@RequestMapping("order/shoucangCourse")
public class QianShouCangController {
    @Autowired
    private QianCourseCollectService courseCollectService;
    /**
     * @create by: Username 刘亦辰 
     * @description: 查看是否收藏 
     * @create time: 2022/12/30 15:39
     * @param null
     * @return :  
     **/
    @PostMapping("findFavoriteCourse")
    public Result findFavoriteCourse(@RequestBody ShouCangCourseVo shouCangCourseVo){
        return courseCollectService.findFavoriteCourse(shouCangCourseVo);
    }

    /**
     * @create by: Username 刘亦辰 
     * @description: 收藏喜欢 
     * @create time: 2022/12/30 15:39
     * @param null
     * @return :  
     **/
    @PostMapping("addFavoritescourse")
    public Result addFavoritescourse(@RequestBody ShouCangCourseVo shouCangCourseVo){
        return courseCollectService.addFavoritescourse(shouCangCourseVo);
    }

    /**
     * @create by: Username 刘亦辰 
     * @description: 删除收藏 
     * @create time: 2022/12/30 15:39
     * @param null
     * @return :  
     **/
    @PostMapping("deleteFavoriteCourse")
    public Result deleteFavoriteCourse(@RequestBody ShouCangCourseVo shouCangCourseVo){
        return courseCollectService.deleteFavoriteCourse(shouCangCourseVo);
    }
}